package com.rslai.base.tool.servertest.objectfactory;

import java.lang.reflect.Type;

public class CharFactory extends InstanceFactory {
    protected Object create(Type type, Object value) {
        if (value == null) {
            return type.equals(Character.TYPE) ? Character.valueOf(' ') : null;
        }
        String s = value.toString();
        return Character.valueOf(s.charAt(0));
    }

    protected boolean support(Type type) {
        return (type.equals(Character.class)) || (type.equals(Character.TYPE));
    }
}

